package com.ulrica.morning.controller;

import com.ulrica.morning.dto.PoetryDTO;
import com.ulrica.morning.entity.PoetryInfo;
import com.ulrica.morning.service.PoetryInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 诗词信息表(PoetryInfo)表控制层
 *
 * @author LK
 * @since 2022-04-25 19:05:49
 */
@RestController
@RequestMapping("poetryInfo")
public class PoetryInfoController {
    /**
     * 服务对象
     */
    @Resource
    private PoetryInfoService poetryInfoService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public PoetryInfo selectOne(Long id) {
        return this.poetryInfoService.queryById(id);
    }

    @GetMapping("queryList")
    public List<PoetryDTO> queryList(Integer start, Integer length) {
        return poetryInfoService.queryList(start, length);
    }

}